package com.zhang;

import java.util.concurrent.CountDownLatch;

public interface CountDownLatch1 {
    public static void main(String[] args) {
        CountDownLatch countDownLatch = new CountDownLatch(6);
        for (int i = 0; i < 6; i++) {
            new Thread(()->{
                System.out.println("线程："+Thread.currentThread().getName()+"\t离开商场");
                countDownLatch.countDown();
            },String.valueOf(i)).start();
        }
        try {
            countDownLatch.await();
            System.out.println("***************顾客都离开了，商场下班了，关门！");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
